#!/bin/sh

sdkdir=/opt/android-studio/sdk/
libs="android-support-v7-appcompat.jar android-support-v7-mediarouter.jar android-support-v4.jar google-play-services_lib.jar"

cls=
for i in $libs ; do 
    echo $i
    case $i in 
	android*)
	    t=`basename $i .jar | tr '-' '/'`
	    d=${sdkdir}/extras/${t}
	    if test -f $d/$i ; then 
		p=$d/$i 
	    elif test -f $d/bin/$i ; then 
		p=$d/bin/$i
	    fi
	    ;;
	google*)
	    b=`basename $i .jar`
	    t=`basename $b _lib | tr '-' '_'`
	    p=${sdkdir}/extras/google/${t}/libproject/${b}/bin/$i 
	    ;; 
    esac
    echo "=== $p"
    if test "x$cls" = "x" ; then 
	cls=$p
    else 
	cls="$cls:$p"
    fi
done

/usr/lib/jvm/default-java/bin/javadoc \
    -protected \
    -splitindex \
    -use \
    -author \
    -version \
    -exclude android.support:com.google.android \
    -quiet \
    -classpath $cls \
    -sourcepath src:${HOME}/git/CastCompanionLibrary-android/src:${sdkdir}/sources/android-19 \
    -d /home/hehi/cholm/public_html/castdr/doc \
    -subpackages org.cholm.media.castdr:com.google.sample.castcompanionlibrary
